Add modifier-only chord and double-tap modifier shortcuts on macOS#30
Merged
Conversation
The cancel-recording hotkey now accepts bare keys like Esc by going through a permissive parser and being registered globally only while a recording is in flight — the useHotkeyRecording hook owns the register/unregister lifecycle. Settings + onboarding switch to a parse-only validate command so picking a combo never holds the key outside the recording window. https://claude.ai/code/session_01AD2Gcj4j75xvaJb9oFpyCJ
Wires tauri-plugin-autostart into the Tauri builder (macOS Login Item via AppleScript, Windows registry Run key, Linux .desktop file), grants the capability set, and surfaces a Start at login toggle in both the Hotkeys onboarding step and Settings → Recording. The frontend bindings go through a small @/lib/autostart helper so component tests can mock a single import path. https://claude.ai/code/session_01AD2Gcj4j75xvaJb9oFpyCJ
Extends the macOS CGEventTap path to recognize two new shortcut surfaces
that tauri-plugin-global-shortcut can't express on its own:
* Modifier-only chord, e.g. Cmd+Opt — fires when the exact modifier
set becomes held and nothing else has been pressed.
* Double-tap of a single modifier, e.g. tap Cmd twice — fires on the
second press within ~350ms when the modifier has been the only key
held both times.
Adds parse_modifiers_only / parse_double_tap so the JS combo string
("Cmd+Opt" or "DoubleTap+Cmd") routes through the existing
HotkeyCombo enum to a new MacOsChordTap. Non-macOS platforms return
a clear "macOS-only" error for these surfaces.
HotkeyInput grows a chord/double-tap detector behind a new
allowChord prop (default true). The cancel-hotkey input opts out
since its backend can't share the single chord tap.
https://claude.ai/code/session_01AD2Gcj4j75xvaJb9oFpyCJ
- Cover the new HotkeyCombo::ModifiersOnly / DoubleTap variants in MacOsFnTap::register so the match is exhaustive. - Add a manual Debug impl on MacOsChordTap so tests can .unwrap_err() the construction Result (the Arc<dyn Fn> callback can't derive Debug; we render it as <callback>). https://claude.ai/code/session_01AD2Gcj4j75xvaJb9oFpyCJ
LeydenJar
approved these changes
May 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CGEventTap-based backend (MacOsChordTap):Cmd+Optheld together with no other key, fires once on the press edgeCmdtwice within ~350ms, fires on the second press"Cmd+Opt"(modifier-only) and"DoubleTap+Cmd"(double-tap) combo strings and route them to the chord backend instead of the standard global-shortcut pluginHotkeyInput) to detect and emit these new combo types during recordingtauri-plugin-autostartintegration for app launch-on-login toggle in Settings and OnboardingCmd+Escto bareEsc(now supported via permissive parser) and adds validation/registration lifecycle managementTest plan
parse.rs)macos_chord.rs)HotkeyInput.test.tsx)useHotkeyRecording.test.tsx,SettingsRecording.test.tsx,OnboardingScreen.test.tsx)Documentation update obligations
register_cancel_hotkey,unregister_cancel_hotkey,validate_cancel_hotkey) →docs/architecture.md(command surface section)docs/architecture.md(shortcut backend section)docs/permissions.md(if applicable) ordocs/architecture.mdBreaking changes
None. The new combo types are additive; existing standard combos continue to work unchanged.
https://claude.ai/code/session_01AD2Gcj4j75xvaJb9oFpyCJ